<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访问标签体</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            $(".c1").click(function(){
                console.log($(this).html());
                console.log($(this).text());
                // $(this).html("<h2>这是修改后的标题</h2>")
                $(this).text("<h2>这是修改后的标题</h2>")
            });
        })
    </script>
</head>
<body>
<div class="c1">
  <h2>这是div中的标题</h2>
</div>
</body>
</html>